<?php $this->_extends('../_layouts/blank_layout'); ?>
<?php $this->_block('contents'); ?>
<link href="<?=Q::ini('custom_system/base_url')?>css/main.css" rel="stylesheet" type="text/css" />
<link type="text/css" href="<?=Q::ini('custom_system/base_url')?>css/jq.ui.css" rel="stylesheet" />
<script type="text/javascript" src="<?=Q::ini('custom_system/base_url')?>js/jq.js"></script>
<script type="text/javascript" src="<?=Q::ini('custom_system/base_url')?>js/jq.ui.js"></script>
<script type="text/javascript">
$(function(){
	$(".base_btn").click(function(){
		parent.window.location.href="<?=url('Online::EbayTemplate/BasePartCreate', array('id' => $_GET['id']))?>";
	});
});
</script>
<h3>基板详细信息</h3>
<table class="form_table" width="80%">
<tr>
	<th>基板名称</th>
	<td><?=$base['name']?></td>
	<th>基板类型</th>
	<td><?=Helper_BSS_Normal::getIniOne('ebay_template_base_type', 'value', $base['type'], 'name')?></td>
</tr>
<tr>
	<th>所在路径</th>
	<td><?=$base['path']?></td>
	<th>创建时间</th>
	<td><?=$base['create_time']?></td>
</tr>
</table>
<h3>基板块列表</h3>
<table width="100%" class="list_table">
<tr>
	<th>ID</th>
	<th>名称</th>
	<th>变量名</th>
	<th width="120">操作</th>
</tr>
<?foreach ($base['part'] as $bp):?>
<tr>
	<td><?=$bp['id']?></td>
	<td><?=$bp['name']?></td>
	<td><?=$bp['variable_name']?></td>
	<td>
		<a href="<?=url('Online::EbayTemplate/BasePartEdit', array('id' => $bp['id']))?>">编辑</a>
		<a href="<?=url('Online::EbayTemplate/BasePartDelete', array('id' => $bp['id'], 'parent_action_id' => $_GET['id']))?>" onclick="if (! confirm('确定删除?')) return false;">删除</a>
		<a href="<?=url('Online::EbayTemplate/BasePartModuleCreate', array('id' => $bp['id'], 'parent_action_id' => $_GET['id']))?>">添加模块</a>
	</td>
</tr>
<?if ($bp['module']):?>
<tr class="attr">
	<td colspan="4">
		<table width="100%">
			<tr>
				<td>模块名称</td>
				<td>模块变量名</td>
				<td>排序</td>
				<td>类型</td>
				<td width="120">模块操作</td>
			</tr>
			<?foreach ($bp['module'] as $bpm):?>
			<tr>
				<td><?=$bpm['name']?></td>
				<td><?=$bpm['variable_name']?></td>
				<td><?=$bpm['sort']?></td>
				<td><?=$bpm['type']?></td>
				<td>
					<a href="<?=url('Online::EbayTemplate/BasePartModuleEdit', array('id' => $bpm['id'], 'parent_action_id' => $_GET['id']))?>">修改模块</a>
					<a href="<?=url('Online::EbayTemplate/BasePartModuleDelete', array('id' => $bpm['id'], 'parent_action_id' => $_GET['id']))?>" onclick="if (! confirm('确定删除?')) return false;">删除模块</a>
				</td>
			</tr>
			<?endforeach;?>
		</table>
	</td>
</tr>
<?endif;?>
<?endforeach;?>
</table>
<div><input type="button" class="button base_btn" value="添加基板块" /> | <a href="<?=url('Online::EbayTemplate/BasePartModuleCreate', array('parent_action_id' => $_GET['id']))?>"><input type="button" class="button" value="添加模块" /></a></div>
<?php $this->_endblock();?>